package com.driver.system.service.impl;

import com.driver.system.db.dao.MisDriverFineDao;
import com.driver.system.db.dao.MisDriverLockDownDao;
import com.driver.system.db.pojo.DriverFineEntity;
import com.driver.system.db.pojo.DriverLockdownEntity;
import com.driver.system.service.DriverFineService;
import com.driver.system.service.DriverLockDownService;
import com.driver.system.util.PageUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

/**
 * @author 14375
 */
@Service
public class DriverLockDownServiceImpl implements DriverLockDownService {
    @Resource
    private MisDriverLockDownDao misDriverLockDownDao;


    @Override
    public PageUtils searchDriverLockdownByPage(Map param) {
        ArrayList<HashMap> list = misDriverLockDownDao.searchDriverLockdownByPage(param);
        long count = misDriverLockDownDao.searchDriverLockdownCount(param);
        int start = (Integer) param.get("start");
        int length = (Integer) param.get("length");
        return new PageUtils(list, count, start, length);
    }

    @Override
    public HashMap searchDriverLockdownById(Integer fineId) {
        return misDriverLockDownDao.searchDriverLockdownById(fineId);
    }

    @Override
    public int insertDriverLockdown(DriverLockdownEntity entity) {
        return misDriverLockDownDao.insertDriverLockdown(entity);
    }

    @Override
    public int updateDriverLockdown(Map param) {
        return misDriverLockDownDao.updateDriverLockdown(param);
    }

    @Override
    public int deleteDriverLockdownByIds(Integer[] ids) {
        return misDriverLockDownDao.deleteDriverLockdownByIds(ids);
    }
}
